<form class="layui-form" action="">
    <input name="eConfigId" id="eConfigId1" type="hidden" />

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">选择配置:</label>
            <div class="layui-input-inline">
                <input type="text" name="eConfigName" id="eConfigName1" lay-filter="tree" placeholder="请选择配置"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">选择表:</label>
            <div class="layui-input-inline">
                <input type="text" name="eTabName" id="eTabName1" lay-filter="tree" placeholder="请选择要同步的表"  autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>


</form>

<script type="text/javascript">

    $(document.body).on('click', '#eConfigName1', function () {
        // 获取配置列表
        layui.use('layer', function() {
            var $ = layui.jquery, layer = layui.layer;

            var layId = layer.open({
                title:'请选择配置',
                id: 'LAY_configTree',//设定一个id，防止重复弹出
                type: 1,
                area: ['300px', '400px'],
                shadeClose: true,
                closeBtn: 0,
                content: getHtml('/sys/config/tree.html')
            });

            $('#tempSyncLayId').attr('layId',layId);
        });
    });

    $(document.body).on('click', '#eTabName1', function () {
        let cid = $('#eConfigId1').val();
        if (cid == null || cid == ''){
            layer.alert('请先选择配置');
        }else {
            // 加载数据表列表
            $(function () {
                $.ajax({
                    type:'get',
                    url:'mysql/getMasterTabList?configId='+cid,
                    success:function (res) {
                        $('#tempTabTreeData').data('tempTabTreeData',res.data);

                        // 获取表列表
                        layui.use('layer', function() {
                            var $ = layui.jquery, layer = layui.layer;

                            var layId = layer.open({
                                title:'请选择需要同步的表',
                                id: 'LAY_tabTree',//设定一个id，防止重复弹出
                                type: 1,
                                area: ['300px', '400px'],
                                shadeClose: true,
                                closeBtn: 0,
                                content: getHtml('/sys/tab/tree.html')
                            });

                            $('#tempSyncLayId').attr('layId',layId);
                        });
                    }
                })
            });

        }

    });




</script>